A regular expression is a sequence of characters that define a search pattern. A string searching algorithm may process the regular expression to match the pattern against strings of text.